package org.example

import org.apache.spark.SparkConf
import org.apache.spark.streaming.{Seconds, StreamingContext}

object SparkStreamingData2_1 {
  def main(args: Array[String]): Unit = {
    val sparkConf =new SparkConf().setMaster("local[2]").setAppName("NetworkWordCount")
    val ssc =new StreamingContext(sparkConf,Seconds(5))
    val lines=ssc.socketTextStream("192.168.64.129",8888)
    println(lines)
    ssc.start()
    ssc.awaitTermination()
    ssc.stop()
  }

}
